#include "ttl.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Widget w;
    QSystemHotkey QSystemHotkeyThread;

    // connect ShortCutKey Thread with widget slot.
    QObject::connect(&QSystemHotkeyThread, SIGNAL(runHotkey(int)),&w,SLOT(hotkeyPressed(int)));
    QObject::connect(&w, SIGNAL(beginHotkeys(void)),&QSystemHotkeyThread,SLOT( beginHotkeys(void)));
    QObject::connect(&w, SIGNAL(haltHotkeys(void)),&QSystemHotkeyThread,SLOT(haltHotkeys(void)));

    //add hot keys
//   QSystemHotkeyThread.addKey(200,MOD_ALT,' ');
//    hotkeys->addKey(300,MOD_CONTROL,'X');
  //  QSystemHotkeyThread.addKey(300,MOD_CONTROL,'X');
    // runn thread
    QSystemHotkeyThread.start();
    w.show();

    return a.exec();
}
